import request from '@/utils/request'

//管理员列表
export function getManagetList(params) {
    return request({
        url: '/back/manager/getManagetList',
        method: 'get',
        params
    })
}

// 新增管理员
export function addManager(data) {
    return request({
        url: '/back/manager/addManager',
        method: 'post',
        data
    })
}

//删除
export function delManageById(params) {
    return request({
        url: '/back/manager/delManager',
        method: 'DELETE',
        params
    })
}

//获取全部角色列表
export function getRoleList(params) {
    return request({
        url: '/back/role/getRoleList',
        method: 'get',
        params
    })
}

//获取管理员的角色列表

export function roleListByManager(params) {
    return request({
        url: '/back/manager/getRoleListByManager',
        method: 'get',
        params
    })
}

// 设置管理员的权限角色
export function setRoleByManager(data) {
    return request({
        url: '/back/manager/setRoleByManager',
        method: 'post',
        data
    })
}

//新增角色
export function addRole(data) {
    return request({
        url: '/back/role/addRole',
        method: 'post',
        data
    })
}

//删除角色
export function delRole(params) {
    return request({
        url: '/back/role/delRole',
        method: 'DELETE',
        params
    })
}

// 获取菜单列表
export function getAuthorityMenuList(params) {
    return request({
        url: '/back/menu/getMenuList',
        method: 'get',
        params
    })
}

// 设置角色权限
export function setAuthorityByRole(data) {
    return request({
        url: '/back/role/setAuthorityByRole',
        method: 'PUT',
        data
    })
}

// 添加权限菜单
export function addAuthorityMenu(data) {
    return request({
        url: '/back/menu/addMenu',
        method: 'post',
        data
    })
}

// 删除权限菜单
export function delMenuById(params) {
    return request({
        url: '/back/menu/delMenu',
        method: 'delete',
        params
    })
}

// 获取权限菜单详情
export function getMenuInfoById(params) {
    return request({
        url: '/back/menu/getMenuById',
        method: 'get',
        params
    })
}

// 修改权限菜单
export function updateMenu(data) {
    return request({
        url: '/back/menu/putMenu',
        method: 'put',
        data
    })
}

// 获取模块或菜单
export function getMenuByCondition(params) {
    return request({
        url: '/back/menu/getMenuByFid',
        method: 'get',
        params
    })
}

// 获取角色的菜单列表
export function getAuthorityByRole(params) {
    return request({
        url: '/back/role/getAuthorityByRole',
        method: 'get',
        params
    })
}